﻿using System;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using System.Data.Entity.ModelConfiguration.Conventions;
using RN.ERP.Entity.ZBDLRY;
using RN.ERP.Entity.Authority;
using Fly.Log;

namespace RN.ERP.DAL.Context
{
    public class ZBDL_Context : DbContext
    {
        private const string CONNECTION_STRING_NAME = "name=ZbdlryConnectionString";

        public ZBDL_Context()
            : base(CONNECTION_STRING_NAME)
        {
            Database.SetInitializer<ZBDL_Context>(null);
        }

        #region 实体操作集合
        /// <summary>
        /// 用户表。
        /// </summary>
        public DbSet<T_Sys_Users_Zbdl> T_Sys_Users { get; set; }
        public DbSet<tb_Corp_Quality_Zbdlry> Corp_CompanyQualities { get; set; }
        //public DbSet<v_CheckXMFZR> CheckXMFZR { get; set; }
        public DbSet<Zb_emp_LockCertificate> LockCertificate { get; set; }
        //public DbSet<Zb_TempLock_Zbdl> ZbTempLock { get; set; }
        public DbSet<Tb_Corp_CompanyInfo_Zbdl> Corp_CompanyInfos { get; set; }
        public DbSet<T_Sys_Dictionary_Zbdl> Dictionarys { get; set; }

        /// <summary>
        /// 状态表。
        /// </summary>
        public DbSet<Tb_FlowCode_Zbdl> FlowCodes { get; set; }
        /// <summary>
        /// 人员表。
        /// </summary>
        public DbSet<tb_Emp_Manager_Zbdl> Emp_Manager { get; set; }
        /// <summary>
        /// 职务
        /// </summary>
        public DbSet<Tb_Emp_Jobs_Zbdl> Emp_Jobs { get; set; }
        /// <summary>
        /// 职称
        /// </summary>
        public DbSet<Tb_Emp_Post_Zbdl> Emp_Post { get; set; }
        /// <summary>
        /// 人员资格证书。
        /// </summary>
        public DbSet<Tb_Emp_TitleDetails_Zbdl> Emp_Qualities { get; set; }
        /// <summary>
        /// 人员安全考核证。
        /// </summary>
        public DbSet<Tb_Emp_TitleDetailsExt_Zbdl> Emp_TitleDetailsExt { get; set; }
        /// <summary>
        /// 项目经理B证。
        /// </summary>
        public DbSet<CMPersonSafeCert> BCards { get; set; }
        public DbSet<Tb_ChangeItemEx> ChangeItems { get; set; }
        public DbSet<Tb_ChangeItemSubEx> ChangeItemSubs { get; set; }
        public DbSet<Tb_ChangeRecordEx> ChangeRecords { get; set; }
        public DbSet<V_ChangeInfoEx> ChangeSetInfo { get; set; }
        public DbSet<Tb_ChangeSetRecordEx> ChangeSetRecords { get; set; }
        public DbSet<tb_ChangeItemUploadEx> ChangeItemUploadEx { get; set; }
        public DbSet<T_Sys_Roles> SysRoles { get; set; }
        public DbSet<T_Sys_RoleGroup> SysRoleGroups { get; set; }
        public DbSet<T_Sys_UserRole> SysUserRoles { get; set; }
        public DbSet<T_Sys_Function> SysFunction { get; set; }
        public DbSet<a_AreaInfo_Zbdl> AreaInfo { get; set; }
        public DbSet<a_AreaSubInfo_Zbdl> AreaSubInfo { get; set; }
        public DbSet<CMFlow_Zbdl> CMFlow { get; set; }
        public DbSet<FlEntityCredit_Zbdl> FlEntityCredit { get; set; }
        public DbSet<T_Sys_FuncPermission> SysFuncPermission { get; set; }
        public DbSet<T_Sys_Control> SysControl { get; set; }
        public DbSet<T_Sys_ControlFunction> SysConFunction { get; set; }
        public DbSet<tb_Emp_TitleClass_Zbdl> tb_Emp_TitleClass { get; set; }
        public DbSet<tb_Emp_TitleType_Zbdl> tb_Emp_TitleType { get; set; }
        public DbSet<a_Speciality_Zbdl> a_Speciality { get; set; }
        public DbSet<T_sys_Role_Kind_Grade_Zbdl> Role_Kind_Grade { get; set; }
        //public DbSet<tb_Corp_CorpKind_Zbdl> JGCorpKinds { get; set; }
        public DbSet<Tb_emp_ManagerCertCount_Zbdl> emp_ManagerCertCount { get; set; }
        public DbSet<tb_CAPayInfo> CAPayInfo { get; set; }
        public DbSet<tb_CAPayInfo_Sub> CAPayInfoSub { get; set; }
        public DbSet<tb_PayInfo> PayInfo { get; set; }
        public DbSet<tb_PayInfo_Sub> PayInfoSub { get; set; }
        public DbSet<tb_ProductInfo> ProductInfo { get; set; }
        public DbSet<tb_ProductGroupInfo> GroupInfo { get; set; }
        public DbSet<Tb_Invoice> Invoice { get; set; }
        public DbSet<Tb_InvoiceOrderRelation> InvoiceOrderRelation { get; set; }
        public DbSet<Tb_ProductUpdateInfo> ProductUpdateInfo { get; set; }
        public DbSet<CA_Cert> caCert { get; set; }

        /// <summary>
        /// T_sys_dict
        /// </summary>
        public DbSet<T_Sys_Dict_Zbdlry> Dictionary { get; set; }
        public DbSet<T_Sys_DictRelation_Zbdlry> DictionaryRelation { get; set; }
        public DbSet<T_Sys_CodeValidation_Zbdl> T_Sys_CodeValidation { get; set; }
        public DbSet<tb_WorkExperience_Zbdl> WorkExperience { get; set; }

        public DbSet<Tb_Corp_Embranchment_Zbdl> CorpEmbranchment { get; set; }
        public DbSet<Kh_CorpTable_Zbdlry> SecurityInfo { get; set; }
        public DbSet<User_Log> UserLogs { get; set; }
        //public DbSet<tb_CAPayInfo> CAPayInfo { get; set; }
        //public DbSet<tb_CAPayInfo_Sub> CAPayInfoSub { get; set; }
        //public DbSet<tb_ProductInfo> ProductInfo { get; set; }
        public DbSet<a_PostPszgDefine_Zbdl> a_PostPszgDefine { get; set; }
        //public DbSet<tb_ProductGroupInfo> GroupInfo { get; set; }
        //public DbSet<Tb_Invoice> Invoice { get; set; }
        //public DbSet<Tb_InvoiceOrderRelation> InvoiceOrderRelation { get; set; }
        //public DbSet<Tb_ProductUpdateInfo> ProductUpdateInfo { get; set; }
        public DbSet<T_Sys_CorpPsnMapping_Zbdl> T_Sys_CorpPsnMapping { get; set; }
        /// <summary>
        /// 用于建立页面与功能的映射关系。
        /// </summary>
        public DbSet<T_Sys_FuncPageMapping> FuncPageMapping { get; set; }

        public DbSet<h_projectBzk_New> Projects { get; set; }
        public DbSet<h_ProjectCorp> Corps { get; set; }
        public DbSet<h_ProjectManager> Managers { get; set; }
        public DbSet<H_ProjectProof> Proofs { get; set; }

        public DbSet<V_EF_CompanyInfo> CompanyInfoFlow { get; set; }

        public DbSet<V_EF_CompanyInfoJZ> CompanyInfoFlowJZ { get; set; }

        public DbSet<V_EF_CompanyRegYT> CompanyRegFlowYT { get; set; }

        public DbSet<V_EF_CompanyRegLC> CompanyRegFlowLC { get; set; }

        public DbSet<V_EF_Manager> ManagerInfoFlow { get; set; }

        public DbSet<re_DepartmentUsers> DepartmentUsers { get; set; }

        public DbSet<dict_Department> DictDepartment { get; set; }


        public DbSet<a_KhUserDefine> UserDefine { get; set; }

        public DbSet<Tb_Emp_ExamInfo> Exam { get; set; }

        /// <summary>
        /// 算分
        /// </summary>
        public DbSet<e_SorcePublish_2006_Zbdl> SorcePublish { get; set; }

        public DbSet<V_EmpCert> EmpCert { get; set; }

        public DbSet<tb_Emp_ManagerZbRegister> Emp_ManagerZbRegister { get; set; }
        public DbSet<T_Sys_StaticSettings_Zbdl> T_Sys_StaticSettings { get; set; }
        /// <summary>
        /// 扣分项定义表
        /// 2013-12-13 毛凯
        /// </summary>
        public DbSet<a_ItemBiked_Zbdlry> a_ItemBiked { get; set; }
        /// <summary>
        /// 扣分明细表
        /// 2013-12-13 毛凯
        /// </summary>
        public DbSet<h_ItemBiked_Zbdlry> h_ItemBiked { get; set; }

        public DbSet<v_e_DeDuck_Zbdlry> e_DeDuck { get; set; }


        public DbSet<T_Sys_Application> SysApp { get; set; }

        public DbSet<zb_ProjectInfo> ProjectInfo { get; set; }
        public DbSet<zb_TenderPayHistory> TenderPayHistory { get; set; }

        /// <summary>
        /// 专家表
        /// </summary>
        public DbSet<tb_emp_expert_Zbdlry> tb_emp_expert { get; set; }
        /// <summary>
        /// 胶州新闻
        /// </summary>
        public DbSet<tb_Notice_Zbdlry> tb_Notice { get; set; }

        /// <summary>
        /// 考核统计新增
        /// </summary>
        public DbSet<e_SckhVerSumClass_ZBDLRY> SckhVerSumClass { get; set; }
        public DbSet<e_ProjectPrizePunish_ZBDLRY> ProjectPrizePunish { get; set; }
        /// <summary>
        /// 福莱助手公文发布
        /// </summary>
        public DbSet<b_NewsTable_Zbdlry> b_NewsTable { get; set; }

        public DbSet<T_Msg_SentMsg> Messages { set; get; }

        public DbSet<T_Chat_ChatInfo> ChatInfos { set; get; }

        public DbSet<e_PrizeBZH_ZBDL> ePrizeBZH { get; set; }
        // public DbSet<Entity.CorpBzjDate> BZJBack_Date { get; set; }

        public DbSet<tb_Expert_Speciality_Zbdl> ExpSpeciality { get; set; }
        public DbSet<tb_User_Relation_Zbdlry> UserRelation { get; set; }
        public DbSet<T_Sys_UsersInfo> UserDetail { get; set; }

        public DbSet<Exam_ChangeEmp> ExamChangeEmp { get; set; }
        public DbSet<Exam_EmpRoom> ExamEmpRoom { get; set; }
        public DbSet<Exam_Info> ExamInfo { get; set; }
        public DbSet<Exam_KM> ExamKM { get; set; }
        public DbSet<Exam_QC> ExamQC { get; set; }
        public DbSet<Exam_Room> ExamRoom { get; set; }
        public DbSet<Exam_Score> ExamScore { get; set; }
        public DbSet<Exam_SubInfo> ExamSubInfo { get; set; }
        /// <summary>
        /// 烟台咨询互动
        /// </summary>
        public DbSet<zb_Consultation> ZbConsultation { get; set; }
        public DbSet<zb_Consultation_Answer> ZbConsultationAnswer { get; set; }

        public DbSet<tb_dlyjRecord> dlyjRecord { get; set; }

        public DbSet<tb_dlyjRecordSub> dlyjRecordSub { get; set; }

        public DbSet<tb_dlyjRecordBid> dlyjRecordBid { get; set; }

        public DbSet<a_AreaSSQ_zbdl> AreaSSQ { get; set; }

        public DbSet<tb_corp_FinancialInfo> CorpFinancials { get; set; }

        public DbSet<tb_corp_MachineInfo> CorpMachines { get; set; }

        public DbSet<Tb_EntitySnap_Zbdl> EntitySnap { get; set; }



        #region 考核

        public DbSet<Tb_Corp_Snap_Zbdl> CorpSnap { get; set; }

        public DbSet<Tb_Corp_Evaluation_Zbdl> CorpEvaluation { get; set; }

        public DbSet<Tb_Corp_EvaluationSub_Zbdl> CorpEvaluationSub { get; set; }

        public DbSet<Tb_Corp_EvaluationItem_Zbdl> CorpEvaluationItem { get; set; }

        public DbSet<Tb_Corp_AttachInfo_Zbdl> CorpAttachInfo { get; set; }

        public DbSet<tb_Corp_CorpKind_Zbdl> CorpKind { get; set; }

        public DbSet<e_Score_zbdl> Score_zbdl { get; set; }

        public DbSet<e_ScoreType_zbdl> ScoreType_zbdl { get; set; }

        public DbSet<tb_vwEmp_ManagerZbRegisterALL> ManagerZbRegister { get; set; }

        public DbSet<tb_AssessmentDetails> ds_AssessmentDetails{get;set;} //企业年检指标考核详细（达标情况）
        public DbSet<tb_dict_PerformanceAssessmentIndex> ds_AssessmentIndex { get; set; } //企业年检指标

      
        #endregion

        #endregion

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();
        }
    }
}
